package proxy;

import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.support.InvocableHandlerMethod;

import configuration.SpringContextUtil;

/**
 * 自定义 InvocableHandlerMethod
 * 反射调用
 *
 * @author wxf
 */
public class CustomerInvocableHandlerMethod extends InvocableHandlerMethod {
    public CustomerInvocableHandlerMethod(HandlerMethod handlerMethod) {
        super(handlerMethod);
    }

    /**
     * 重写方法反射调用
     */
    @Override
    protected Object doInvoke(Object... args) throws Exception {
        return getMethod().invoke(SpringContextUtil.getBean(getBeanType()), args);

    }
}
